<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('编辑预约记录')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-bReserve-add" th:object="${bReserve}">
        <input id="id" name="id" type="hidden" th:field="*{id}"/>
        <input type="hidden" name="createBy" th:value="${@permission.getPrincipalProperty('loginName')}">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">预定人：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="contacts" id="contacts" th:field="*{contacts}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">联系电话：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="phone" id="phone" th:field="*{phone}" required>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label is-required">主题：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="theme" id="theme" th:field="*{theme}" required>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label is-required">用餐人数：</label>
            <div class="col-sm-8">
                <input class="form-control digits" type="text" name="dinersCount"   th:field="*{dinersCount}" id="dinersCount" required>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">用餐时间：</label>
            <div class="col-sm-8">
                <div class="input-group date"> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input class="form-control" type="text" name="dinnerDate" th:value="${#dates.format(bReserve.dinnerDate, 'yyyy-MM-dd HH:mm')}" id="dinnerDate" required>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label is-required">状态：</label>
            <div class="col-sm-8">
                <select name="status" class="form-control m-b" th:with="type=${@dict.getType('b_reserve_status')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">用餐需求：</label>
            <div class="col-sm-8">
                <textarea id="demand" name="demand" class="form-control" >[[*{demand}]]</textarea>
            </div>
        </div>


        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <textarea id="remark" name="remark" class="form-control" th:field="*{remark}"></textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script type="text/javascript">
    var prefix = ctx + "repast/bReserve";
    $(document).ready(function(){

        $(".input-group.date").datetimepicker({
            format: "yyyy-mm-dd hh:ii",
            autoclose: true
        });
    });
    $("#form-bReserve-add").validate({
        onkeyup: false,
        rules:{

        },
        messages: {

        },
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-bReserve-add').serialize());
        }
    }
</script>
</body>
</html>
